xc_domain_getinfo returns information about a domain, but not
necessarily the one you asked about. Add check for this.
max_vcpu_id in xc_domain_getinfo is really an ID, not a count, so
make the loop include the last VCPU
Signed-off-by: Ben Thomas <ben@virtualiron.com>
goto error_out;
}
- for (i = 0; i < info.max_vcpu_id; i++)
+ if (domid != info.domid) {
+ PERROR("Domain %d does not exist", domid);
+ goto error_out;
+ }
+
+ for (i = 0; i <= info.max_vcpu_id; i++)
if (xc_vcpu_getcontext(xc_handle, domid,
- i, &ctxt[nr_vcpus]) == 0)
+ i, &ctxt[nr_vcpus]) == 0)
nr_vcpus++;
nr_pages = info.nr_pages;